def collatz(n):
    n_copy = n
    cnt = 0
    while n != 1:
        cnt += 1
        if n%2:
            n = 3*n+1
        else:
            n = n//2
    return cnt, n_copy

print(max(map(collatz, range(1, 1000000))))
